package com.ty.controller;

import com.ty.entity.EmployeeQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.ty.entity.Employee;
import com.ty.service.EmployeeService;

import java.util.List;

/**
 * 员工表;(212_employee)控制层
 * @author : heimi
 * @date : 2025-6-11
 */
@RestController
@RequestMapping("/api/employee")
public class EmployeeController{
    @Autowired
    private EmployeeService employeeService;
    
    /** 
     * 查询接口
     */
     @GetMapping
     public List<Employee> select(EmployeeQuery query){
        return employeeService.select(query);
    }
    
    @PostMapping 
    public Integer insert(@RequestBody Employee product){
       return employeeService.insert(product);
    }
    
    @PutMapping 
    public Integer update(@RequestBody Employee product){
        return employeeService.update(product);
    }
    
    @DeleteMapping
    public Integer delete(Integer id){
        return employeeService.delete(id);
    }
}